package com.zzyl.task;

import com.zzyl.mapper.CustomerReservationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Component
public class ReservationTask {

    @Autowired
    private CustomerReservationMapper customerReservationMapper;

    @Scheduled(cron = "0 1,31 * * * ?")
    public void overTimeReservation(){
        customerReservationMapper.updateStatus(LocalDateTime.now());
    }
}
